/*
 * Copyright (c) 2022 Huawei Device Co., Ltd.
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *    http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef OLA_NEGOTIATION_H
#define OLA_NEGOTIATION_H

#include "ola_sdk_api.h"

#ifdef __cplusplus
extern "C" {
#endif

typedef enum {
    OLA_NEGO_STATUS_UNINIT,
    OLA_NEGO_STATUS_INIT,
    OLA_NEGO_STATUS_DOING,
    OLA_NEGO_STATUS_FINISH,
    OLA_NEGO_STATUS_UNKNOWN
} OlaNegoStatus;

typedef struct {
    int (*getPinCodeCb)(unsigned char *pinCode, unsigned int *len);
    int (*sendData)(const OlaData *sendData);
} OlaNegotiationCb;

typedef struct {
    int (*init)(const OlaNegotiationCb *negoCb);
    int (*processData)(const OlaData *inData, OlaData *outData);
    OlaNegoStatus (*getStatus)(void);
    int (*encodeData)(const OlaData *inData, OlaData *outData);
    int (*decodeData)(const OlaData *inData, OlaData *outData);
    void (*deinit)(void);
} OlaNegotiationHook;

const OlaNegotiationHook *OlaGetNegotiationHooks(void);

#ifdef __cplusplus
}
#endif

#endif /* OLA_NEGOTIATION_H */